#encoding: utf-8
import psycopg2
import os
import json
def update_pg():
    dir_path =os.path.dirname(os.path.realpath(__file__))
    print(dir_path)
    file_path = os.path.join(dir_path,'qiubai.json')
    print(file_path)
    if not os.path.exists(os.path.join(dir_path,'qiubai.json')):
        return False
    file_path = os.path.join(dir_path,'qiubai.json')
    qiubai = open(file_path,'r')
    # qiubai_json = json.load(qiubai)

    lines = qiubai.readlines()
    for line in lines:
        if '{' in line and '},' in line:
            tmp_line = line[:-2].replace('\\n','')
            json_line = json.loads(tmp_line)
            print(json_line['content'])

if __name__ == '__main__':
    update_pg()
